﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace AddFileHeaders
{

    internal class PopupWindow : ToolStripDropDown
    {

        private Control content;
        private ToolStripControlHost host;

        public PopupWindow(Control content)
        {

            //Basic setup...
            this.AutoSize = false;
            this.DoubleBuffered = true;
            this.ResizeRedraw = true;

            this.content = content;
            this.host = new ToolStripControlHost(content);

            //Positioning and Sizing
            this.MinimumSize = content.Size;
            this.MaximumSize = content.Size;
            this.Size = content.Size;
            content.Location = Point.Empty;

            //Add the host to the list
            this.Items.Add(this.host);

        }

    }

}
